import { ConfigService } from '@nestjs/config';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { AuthGuard } from './guard/auth.guard';
import { XjwtService } from './xjwt/xjwt.service';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  const xjwtService = app.get(XjwtService)
  const configService = app.get(ConfigService)
  app.useGlobalGuards(new AuthGuard(configService, xjwtService))
  await app.listen(3002);
}
bootstrap();
